package net.hn.hnms.biz.power.repository;

import net.hn.hnms.biz.power.domain.DeviceInfo;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/9/20 17:26
 * 1.0 version
 */
@Repository
public interface DeviceInfoRepository extends JpaRepository<DeviceInfo,String> {

    @EntityGraph(attributePaths = {"sensorInfos.sensorMonitor"})
    List<DeviceInfo> findBySystemCodeOrderBySort(String systemCode);

    @EntityGraph(attributePaths = {"sensorInfos.sensorMonitor"})
    List<DeviceInfo> findBySystemCodeAndMineCodeOrderBySort(String systemCode,String mineCode);
}
